/* -----------------------------------------------------------------------
     _    _ _     _                 _    _                                
    / \  | | | __| |_ __  _ __  ___| | _(_)_ __  ___   ___ ___  _ __ ___  
   / _ \ | | |/ _` | '_ \| '_ \/ __| |/ / | '_ \/ __| / __/ _ \| '_ ` _ \ 
  / ___ \| | | (_| | | | | | | \__ \   <| | | | \__ \| (_| (_) | | | | | |
 /_/   \_\_|_|\__,_|_| |_|_| |_|___/_|\_\_|_| |_|___(_)___\___/|_| |_| |_|

 The Name Of Skin: AllDnnSkins City
 Publish Date: February 5, 2010
 Contact Information: contact@alldnnskins.com
 Copyright by Alldnnskins.com. All Rights Reserved

----------------------------------------------------------------------- */

function addResizeEvent(func) {
	var oldresize = document.body.onresize;
	if (typeof document.body.onresize != "function") {
		document.body.onresize = func;
	} else {
		document.body.onresize = function() {
			if (oldresize) {
				oldresize();
			}
			func();
		}
	}
}

function addLoadEvent(func) {
	var oldload = window.onload;
	if (typeof window.onload != "function") {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldload) {
				oldload();
			}
			func();
		}
	}
}

function layout_trigger() {
	var b_ele = document.body;
	b_ele.style.zoom = b_ele.style.zoom == "1" ? "100%" : "1";
}

function setMinWidth() {
	if (!document.getElementById("outerWrap")) return false;
	var outer_wrap = document.getElementById("outerWrap");
	outer_wrap.style.width = document.body.clientWidth < 960 || document.documentElement.clientWidth < 960 ? "960px" : "auto";
}

function setMinHeight() {
	var outer_wrap = document.getElementById("outerWrap");
	var extradiv2_ele = document.getElementById("extraDiv2");
	var extradiv3_ele = document.getElementById("extraDiv3");
	extradiv2_ele.style.height = outer_wrap.clientHeight;
	extradiv3_ele.style.height = outer_wrap.clientHeight;
}

setMinWidth();
addResizeEvent(layout_trigger);
addResizeEvent(setMinWidth);
addLoadEvent(setMinHeight);
